

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Employee List</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="createEmployee" action="create">New Employee</g:link></span>
        </div>
        <div class="body">
            <h1>Employee List</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                   	        <g:sortableColumn property="firstName" title="Name" />

                                <g:sortableColumn property="title" title="Title" />

                                <g:sortableColumn property="salary" title="Salary (per Month)" />

                                <g:sortableColumn property="percentageWork" title="Working" />

                                

                                <th></th>
                           </tr>
                    </thead>
                    <tbody>
                    <g:each in="${employeeInstanceList}" status="i" var="employeeInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${employeeInstance.id}">${fieldValue(bean:employeeInstance, field:'firstName')} ${fieldValue(bean:employeeInstance, field:'lastName')}</g:link></td>
      
                            <td>${fieldValue(bean:employeeInstance, field:'title')}</td>
                        
                            <td > 
                            <g:formatNumber number="${employeeInstance.salary}" format="SEK ##,##0"/>
                            </td>

                            <td>
                            <g:formatNumber number="${employeeInstance.percentageWork}" format="###.##"/> %
                            </td>

                           
                            <td>
                              <form method="Post" action="delete">
                                  <input type="hidden" name="id" value="${employeeInstance?.id}" />
                                  <span class="button"><input type="submit"  value="" title="Delete" class="listDelete" onclick="return confirm('Are you sure?');" /></span>
                              </form>
                            </td>
 
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${employeeInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
